import Vue from 'vue'
import Router from 'vue-router'
import HelloWorld from '@/components/HelloWorld'
import Home from '@/components/Home'
import News from '@/components/News'
import Hot from '@/components/Hot'
import Film from '@/components/Film'
import Read from '@/components/Read'
import HotDetail from '@/components/HotDetail'
import NotFound404 from '@/components/NotFound404'
import Chome from '@/components/Chome'
import Cnews from '@/components/Cnews'
import Chot from '@/components/Chot'
import Cfilm from '@/components/Cfilm'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      name: 'HelloWorld',
      component: HelloWorld
    },
    {path:"/home",name:"home",component:Home},
    {path:"/news",name:"news",component:News,children:[
      {path:"film",component:Film},
      {path:"read",component:Read},
      // 跳转 指定内容
      {path:"/",redirect:"film"}
    ]},
    {path:"/hot",name:"hot",component:Hot},
    // 传参配置
    {path:"/hot/:id/:cont",component:HotDetail},
    // 匹配所有路径
    {path:"*",component:NotFound404},

    {path:'/homee',component:Chome},
    {path:'/aboutUs',component:Cnews},
    {path:'/account',component:Chot,children:[
            {path:"pwd",component:{template:"<h1>密码</h1>"}},
        ]},
    {path:"/login",component:Cfilm}
  ]
})
$(function(){
  console.log(1);
})
